move signal and semaphore to _common/#53457
Merged
Conversation
Signed-off-by: abrar <abrar@anyscale.com>
Signed-off-by: abrar <abrar@anyscale.com>
edoakes
reviewed
Jun 2, 2025
Collaborator
edoakes
left a comment
There was a problem hiding this comment.
Thanks, especially for also adding the tests! Mostly just a comment on the naming
| import sys | ||
| import ray | ||
| from ray._common.synchronization_actors import SignalActor, Semaphore | ||
| from ray._private.test_utils import wait_for_condition |
Collaborator
There was a problem hiding this comment.
wait_for_condition is probably up next :)
_common/
Signed-off-by: abrar <abrar@anyscale.com>
Signed-off-by: abrar <abrar@anyscale.com>
Signed-off-by: abrar <abrar@anyscale.com>
edoakes
approved these changes
Jun 2, 2025
Collaborator
edoakes
left a comment
There was a problem hiding this comment.
LGTM. We should probably run the full set of postmerge tests on this before merging to be sure nothing is missed. Asking Lonnie how to do that.
Collaborator
|
turns out doing that is a bit annoying:
so let's see if anything breaks and revert if needed :) |
edoakes
pushed a commit
that referenced
this pull request
Jun 5, 2025
…s` directory (#53543) ## Why are these changes needed? In #53457 we moved signal and semaphore to `_common/` which is used in `serve` tests. However, after that, `_common` had two `test_utils` which was confusing. This PR reorganizes the test utilities and their tests for better clarity: **Key Changes:** - Keep `SignalActor` and `Semaphore` test utility classes in `_common/test_utils.py` to ensure they're included in Ray package distribution (external libraries need access to these) - Separate tests for utility functions into `_common/tests/test_utils.py` (tests for `ray._common.utils` functions) - Rename and move tests for test utility classes to `_common/tests/test_signal_semaphore_utils.py` (tests for `SignalActor` and `Semaphore`) - Add comprehensive documentation and comments explaining the organization **Final Organization:** - `_common/test_utils.py`: Test utility classes (`SignalActor`, `Semaphore`) - distributed with Ray package - `_common/tests/test_utils.py`: Tests for Ray utility functions (`get_or_create_event_loop`, `run_background_task`) - `_common/tests/test_signal_semaphore_utils.py`: Tests for test utility classes This resolves the confusion of having multiple `test_utils` files while ensuring test utilities remain accessible to external libraries that depend on Ray. The separation maintains clear boundaries between utility classes (for distribution) and their tests (for development). --------- Signed-off-by: Sagar Sumit <sagarsumit09@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #53478